﻿using IM.Easy.Core.Services;
using IM.Easy.Entity.System;
using IM.Easy.Infrastructure.Query;
using IM.Easy.SystemServices.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.SystemServices.IServices
{
    /// <summary>
    /// 字典服务
    /// </summary>
    public interface IDictTypeService : IAppServices<SysDictType>
    {
        /// <summary>
        /// 添加字典
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<long> AddAsync(DictTypeDto dto);

        /// <summary>
        /// 更新字典
        /// </summary>

        bool Update(DictTypeDto dto);

        /// <summary>
        /// 获取字典类型
        /// </summary>
        /// <returns>字典类型列表</returns>
        PageResponse<DictTypeDto> GetList(DictTypeQueryDto query);


        /// <summary>
        /// 通过编码获取详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        DictTypeDto GetById(long id);

        /// <summary>
        /// 判断字典组下是否存在数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool HasDictData(long id);
        ///// <summary>
        ///// 删除字典
        ///// </summary>
        ///// <param name="ids">字典ID</param>
        ///// <returns>是否删除成功</returns>
        //Task<bool> DeleteAsync(int[] ids);

        ///// <summary>
        ///// 更新字典信息
        ///// </summary>
        ///// <param name="dto">更新后的字典信息</param>
        ///// <returns>是否更新成功</returns>
        //Task<bool> UpdateAsync(int id, DictTypeDto dto);

        ///// <summary>
        ///// 根据字典类型获取
        ///// </summary>
        ///// <param name="type"></param>
        ///// <returns></returns>
        //Task<DictTypeDto> GetDictTypeAsync(string type);

        ///// <summary>
        ///// 清除缓存
        ///// </summary>
        //void ClearCache();
    }
}
